package com.magina.common.service;

import com.magina.basic.api.SysLogService;
import com.magina.basic.model.SysLog;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassnName :com.magina.common.service.SysLogConsumerService
 * @Author： Magina.Hu
 * @Date： 2019/4/23
 * @Description：
 * @Version: V1.0
 * Copyright (c) 2019-2020 .All rights reserved.
 */
@Component
public class SysLogConsumerService {

    @Reference(version = "1.0.0", url = "dubbo://127.0.0.1:12345")
    private SysLogService sysLogService;

    public List<SysLog> findList(){
        System.out.println(this.getClass().getName() + Thread.currentThread() .getStackTrace()[1].getMethodName());
        List<SysLog> o = sysLogService.findList();
        return o;
    }

    public void insert(SysLog sysLog){
        System.out.println(this.getClass().getName() + Thread.currentThread() .getStackTrace()[1].getMethodName());
        sysLogService.insert(sysLog);
    }

}
